package org.hzero.system.domain;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.hzero.system.annotation.KnifeValidateStrLength;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author: tianhao.luo@hand-china.com 2021/3/3  10:12
 */
public class SourceParentDTO {
    /**
     * 字符串类型
     */
    @KnifeValidateStrLength(name = "父的字符串属性",maxLength = 5)
    public String parentStrField;
    /**
     * 时间类型
     */
    public Date parentDateField;
    /**
     * 整型
     */
    public Integer parentIntField;
    /**
     * 长整型
     */
    public Long parentLongField;
    /**
     * 金额数字类型
     */
    public BigDecimal parentDecimalField;

    public String getParentStrField() {
        return parentStrField;
    }

    public void setParentStrField(String parentStrField) {
        this.parentStrField = parentStrField;
    }

    public Date getParentDateField() {
        return parentDateField;
    }

    public void setParentDateField(Date parentDateField) {
        this.parentDateField = parentDateField;
    }

    public Integer getParentIntField() {
        return parentIntField;
    }

    public void setParentIntField(Integer parentIntField) {
        this.parentIntField = parentIntField;
    }

    public Long getParentLongField() {
        return parentLongField;
    }

    public void setParentLongField(Long parentLongField) {
        this.parentLongField = parentLongField;
    }

    public BigDecimal getParentDecimalField() {
        return parentDecimalField;
    }

    public void setParentDecimalField(BigDecimal parentDecimalField) {
        this.parentDecimalField = parentDecimalField;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("SourceParentDTO{");
        sb.append("parentStrField='").append(parentStrField).append('\'');
        sb.append(", parentDateField=").append(parentDateField);
        sb.append(", parentIntField=").append(parentIntField);
        sb.append(", parentLongField=").append(parentLongField);
        sb.append(", parentDecimalField=").append(parentDecimalField);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        SourceParentDTO that = (SourceParentDTO) o;

        return new EqualsBuilder()
                .append(parentStrField, that.parentStrField)
                .append(parentDateField, that.parentDateField)
                .append(parentIntField, that.parentIntField)
                .append(parentLongField, that.parentLongField)
                .append(parentDecimalField, that.parentDecimalField)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(parentStrField)
                .append(parentDateField)
                .append(parentIntField)
                .append(parentLongField)
                .append(parentDecimalField)
                .toHashCode();
    }
}
